/**
 * Copyright 2020 Inc.
 **/
package com.myz.cloud.rocketmq.consumer.mq;

import com.myz.cloud.rocketmq.config.Order;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 记得需要加入容器中@Component
 * topic：和消费者发送的topic相同
 * group：不用和生产者group相同
 *
 * @author maoyz0621 on 2020/8/5
 * @version v1.0
 */
@RocketMQMessageListener(topic = "${rocketmq.topic.order}",
        consumerGroup = "${rocketmq.topic.order}",
        selectorExpression = "*",
        enableMsgTrace = true,
        customizedTraceTopic = "${rocketmq.consumer.customized-trace-topic}")
@Component
@Slf4j
public class MqConsumerTypeOrder implements RocketMQListener<Order> {

    @Override
    public void onMessage(Order message) {
        log.info("接收到消息order -> {}", message);
    }
}